package com.ruoyi.quartz.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.domain.*;
import com.ruoyi.quartz.mapper.SyncDataMapper;
import com.ruoyi.quartz.service.ISyncDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class SyncDataImpl implements ISyncDataService {

    @Autowired
    public SyncDataMapper syncDataMapper;

    @Override
    public List<WeaveReport> queryWeaveReportList(WeaveReport weaveReport) {
        List<WeaveReport> list = syncDataMapper.queryWeaveReportList(weaveReport);
       /* list = list.stream().map(item -> {
            List<OperatorInfo> operatorInfoList = new ArrayList<OperatorInfo>();
            OperatorInfo peratorInfo = new OperatorInfo();
            peratorInfo.setOperatorAccount(item.getEAttribute45());
            peratorInfo.setTeamName(item.getEAttribute26());
            peratorInfo.setTeamShift(Convert.toStr(item.getEAttribute66(), ""));
            peratorInfo.setQuantity(Double.parseDouble(item.getEAttribute27()));
            operatorInfoList.add(peratorInfo);

            if (!StringUtils.isEmpty(item.getEAttribute28())) {
                OperatorInfo peratorInfo2 = new OperatorInfo();
                peratorInfo2.setOperatorAccount(item.getEAttribute28());
                peratorInfo2.setTeamName(item.getEAttribute35());
                peratorInfo2.setTeamShift(Convert.toStr(item.getEAttribute66(), ""));
                peratorInfo2.setQuantity(Double.parseDouble(item.getEAttribute36()));
                operatorInfoList.add(peratorInfo2);
            }
            item.setOperatorInfoList(operatorInfoList);
            return item;
        }).collect(Collectors.toList());*/
        return list;
    }

    @Override
    public List<WeaveReport> queryWeaveReportList1(String orgid) {
        return syncDataMapper.queryWeaveReportList1(orgid);
    }

    @Override
    public void updateWeaveReport(WeaveReport weaveReport) {
        syncDataMapper.updateWeaveReport(weaveReport);
    }

    @Override
    public void updateWeaveReport_N(WeaveReport weaveReport) {
        syncDataMapper.updateWeaveReport_N(weaveReport);
    }

    @Override
    public List<WeaveJs> queryWeaveJsList(String orgId) {
        return syncDataMapper.queryWeaveJsList(orgId);
    }

    @Override
    public void updateWeaveJs(WeaveJs weaveJs) {
        syncDataMapper.updateWeaveJs(weaveJs);
    }

    @Override
    public void updateWeaveJs_N(WeaveJs weaveJs) {
        syncDataMapper.updateWeaveJs_N(weaveJs);
    }

    @Override
    public List<WeaveSz> queryWeaveSzList(String orgId) {
        return syncDataMapper.queryWeaveSzList(orgId);
    }

    @Override
    public void updateWeaveSz(WeaveSz weaveSz) {
        syncDataMapper.updateWeaveSz(weaveSz);
    }

    @Override
    public void updateWeaveSz_N(WeaveSz weaveSz) {
        syncDataMapper.updateWeaveSz_N(weaveSz);
    }

    @Override
    public List<WeaveKz> queryWeaveKzList(String orgId) {
        return syncDataMapper.queryWeaveKzList(orgId);
    }

    @Override
    public void updateWeaveKz(WeaveKz weaveKz) {
        syncDataMapper.updateWeaveKz(weaveKz);
    }

    @Override
    public void updateWeaveKz_N(WeaveKz weaveKz) {
        syncDataMapper.updateWeaveKz_N(weaveKz);
    }

    @Override
    public List<WeaveXj> queryWeaveXjList(String orgId) {
        return syncDataMapper.queryWeaveXjList(orgId);
    }

    @Override
    public void updateWeaveXj(WeaveXj weaveXj) {
        syncDataMapper.updateWeaveXj(weaveXj);
    }

    @Override
    public void updateWeaveXj_N(WeaveXj weaveXj) {
        syncDataMapper.updateWeaveXj_N(weaveXj);
    }

    @Override
    public List<WeaveCz> queryWeaveCzList(WeaveCz weaveCz) {
        List<WeaveCz> list = syncDataMapper.queryWeaveCzList(weaveCz);
        return list;
    }

    @Override
    public void updateWeaveCz(WeaveCz weaveCz) {
        syncDataMapper.updateWeaveCz(weaveCz);
    }

    @Override
    public void updateWeaveCz_N(WeaveCz weaveCz) {
        syncDataMapper.updateWeaveCz_N(weaveCz);
    }

    @Override
    public List<WeaveLb> queryWeaveLbList(WeaveLb weaveLb) {
        return syncDataMapper.queryWeaveLbList(weaveLb);
    }

    @Override
    public void updateWeaveLb(WeaveLb weaveLb) {
        syncDataMapper.updateWeaveLb(weaveLb);
    }

    @Override
    public void updateWeaveLb_N(WeaveLb weaveLb) {
        syncDataMapper.updateWeaveLb_N(weaveLb);
    }

    @Override
    public List<WeaveJj> queryWeaveJjList(String orgId) {
        return syncDataMapper.queryWeaveJjList(orgId);
    }

    @Override
    public void updateWeaveJj(WeaveJj weaveJj) {
        syncDataMapper.updateWeaveJj(weaveJj);
    }

    @Override
    public void updateWeaveJj_N(WeaveJj weaveJj) {
        syncDataMapper.updateWeaveJj_N(weaveJj);
    }

    @Override
    public List<User> queryUserList(String orgId) {
        return syncDataMapper.queryUserList(orgId);
    }

    @Override
    public List<WeaveXb> queryWeaveXbList(String orgId) {

        return syncDataMapper.queryWeaveXbList(orgId);

    }

    @Override
    public void updateWeaveXb(WeaveXb weaveXb) {
          syncDataMapper.updateWeaveXb(weaveXb);
    }

    @Override
    public List<WeaveTZ> queryTzRecord() {
        return  syncDataMapper.queryTzRecord();
    }

    @Override
    public int updateJZ(WeaveTZ weaveTZ) {
        return syncDataMapper.updateJZ(weaveTZ);
    }

}
